<template>
	<div v-loading="loading">
		<div class="title1">
			<div>
				<span class="h1">基础管理</span>
				<span class="h2">操作员</span>
			</div>
		</div>
		<el-table :data="tableData" style="width: 100%">
			<el-table-column type="index" width="60">
			</el-table-column>
			<el-table-column prop="Login" label="用户名">
			</el-table-column>
			<el-table-column prop="CNName" label="姓名">
			</el-table-column>
			<el-table-column prop="Tel" label="电话">
			</el-table-column>
			<el-table-column prop="StatusStr" label="状态">
			</el-table-column>
			<el-table-column prop="LoginType" label="用户类型">
				<template slot-scope="scope">
					<span v-if="scope.row.LoginType==1">操作员</span>
					<span v-else>业务员</span>
				</template>
			</el-table-column>
			<el-table-column prop="address" label="操作" width="230">
				<template slot-scope="scope">
					<el-dropdown trigger="click">
						<span class="el-dropdown-link"><el-button type="primary">操作<i class="el-icon-arrow-down el-icon--right"></i></el-button></span>
						<el-dropdown-menu slot="dropdown">
							<el-dropdown-item>
								<el-button size="small" type="primary" @click="modify(scope.row.LoginType,scope.row.CNName,scope.row.Login,scope.row.Status,scope.row.Tel)">修改</el-button>
							</el-dropdown-item>
							<el-dropdown-item>
								<el-button size="small" type="success"  @click="lock(scope.$index, scope.row.Login,scope.row.Status)" v-if="scope.row.Status">解锁</el-button>
								<el-button size="small" type="success" @click="lock(scope.$index, scope.row.Login,scope.row.Status)" v-else>锁定</el-button>
							</el-dropdown-item>
							<el-dropdown-item>
								<el-button size="small"  type="danger" @click="deleteRow(scope.$index,scope.row.Login)">删除</el-button>
							</el-dropdown-item>
							<el-dropdown-item>
								<el-button size="small" type="info" @click="fnReset(scope.row.Login)">重置</el-button>
							</el-dropdown-item>
							<el-dropdown-item>
								<el-button size="small" type="primary" @click.native.prevent="setrole(scope.$index, scope.row.Login)">权限</el-button>
							</el-dropdown-item>
							<el-dropdown-item>
								<el-button size="small" type="warning" @click.native.prevent="Unbundling(scope.$index, scope.row.Login)">解绑</el-button>
							</el-dropdown-item>
						</el-dropdown-menu>
					</el-dropdown>
				</template>
			</el-table-column>
		</el-table>
	</div>
</template>

<script>
	import api from '../../kits/api.js';
	export default {
		name: 'Operator',
		data() {
			return {
				loading: false, //Loading 加载
				tableData:[], //操作员列表
			}
		},
		methods: {}
	}
</script>

<style scoped>
	.title1 {
		text-indent: 20px;
		width: 100%;
		padding: 15px 0;
		background: #fff;
		border-bottom: 1px solid #dddee1;
	}
	
	.title1 span {
		margin-right: 10px;
		
	}
	
	.title1 .h1 {
		font-size: 16px;
		font-weight: 600;
	}
	
	.title1 .h2 {
		font-size: 14px;
	}
</style>